/**
 * 组件的公共定义
 * Created by zhouby on 2018/4/20/020.
 */
const row_ = {
    gutter: 48
};
const antModal_ = {
    maskClosable: false,
    mask: true
};
const table_ = {
    // locale: {
    //     emptyText: require('react').createElement('div', {className: "tableNoData iconfont icon-bukaixin",key:"empty"}, [
    //         require('react').createElement('span', {}, "暂无数据")
    //     ])
    // },
    bordered: false,
};
const tablePagination_ = {
    defaultPageSize: 10,
    pageSizeOptions: ['10', '20', '50', '100'],
    showSizeChanger: true
};
const btnName_ = {
    search: "查询",
    reset: "清空"
}

const getPagination_ = function (pagination, onChange, onShowSizeChange) {
    return {
        ...tablePagination_,
        total: pagination !== undefined ? pagination.total : 0,
        defaultCurrent: pagination !== undefined ? pagination.pageNum : 1,
        pageSize: pagination !== undefined ? pagination.pageSize : tablePagination_.defaultPageSize,
        current: pagination !== undefined ? pagination.pageNum : 1,
        onShowSizeChange(current, pageSize) {
            if (onShowSizeChange) {
                onShowSizeChange(1, pageSize);
            } else {
                onChange(1, pageSize);
            }
        },
        onChange(current, pageSize) {
            onChange(current, pageSize);
        }
    };
};

module.exports = {
    antModal_, table_, tablePagination_, getPagination_, btnName_, row_
}
